package com.zczc.tagmanagement.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @ClassName: Tag
* @Description: tag表对应的java bean类
* @author: yishui zhiyubujian@163.com
 */
@Table(name = "tag")
public class Tag implements Serializable {
    /**
     * @Fields tag.id :
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "select uuid()")
    private String id;

    /**
     * 标签名称
     */
    /**
     * @Fields tag.tag_name :标签名称
     */
    @Column(name = "tag_name")
    @NotNull(message = "tagName不能为null")
    @NotEmpty(message = "tagName不能为空")
    private String tagName;

    /**
     * 点击数量
     */
    /**
     * @Fields tag.click_num :点击数量
     */
    @Column(name = "click_num")
    private Integer clickNum;

    /**
     * 文档数量
     */
    /**
     * @Fields tag.document_num :文档数量
     */
    @Column(name = "document_num")
    private Integer documentNum;

    /**
     * 添加时间
     */
    /**
     * @Fields tag.add_time :添加时间
     */
    @Column(name = "add_time")
    private Date addTime;

    /**
     * 所属分类，关联tag_sorts表
     */
    /**
     * @Fields tag.parent_code :所属分类，关联tag_sorts表
     */
    @Column(name = "parent_code")
    @NotEmpty(message ="parentCode不能为空")
    @NotNull(message = "parentCode不能为null")
    private String parentCode;

    /**
     * 逻辑删除
     */
    /**
     * @Fields tag.deleted :逻辑删除
     */
    private Boolean deleted;

    private static final long serialVersionUID = 1L;

    /**
     * @return id
     */
    /**
     * @return tag.id : 返回
     */
    public String getId() {
        return id;
    }

    /**
     * @param id
     */
    /**
     * @param id of tag : 设置
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取标签名称
     *
     * @return tag_name - 标签名称
     */
    /**
     * @return tag.tag_name : 返回 标签名称
     */
    public String getTagName() {
        return tagName;
    }

    /**
     * 设置标签名称
     *
     * @param tagName 标签名称
     */
    /**
     * @param tagName of tag : 设置 标签名称
     */
    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    /**
     * 获取点击数量
     *
     * @return click_num - 点击数量
     */
    /**
     * @return tag.click_num : 返回 点击数量
     */
    public Integer getClickNum() {
        return clickNum;
    }

    /**
     * 设置点击数量
     *
     * @param clickNum 点击数量
     */
    /**
     * @param clickNum of tag : 设置 点击数量
     */
    public void setClickNum(Integer clickNum) {
        this.clickNum = clickNum;
    }

    /**
     * 获取文档数量
     *
     * @return document_num - 文档数量
     */
    /**
     * @return tag.document_num : 返回 文档数量
     */
    public Integer getDocumentNum() {
        return documentNum;
    }

    /**
     * 设置文档数量
     *
     * @param documentNum 文档数量
     */
    /**
     * @param documentNum of tag : 设置 文档数量
     */
    public void setDocumentNum(Integer documentNum) {
        this.documentNum = documentNum;
    }

    /**
     * 获取添加时间
     *
     * @return add_time - 添加时间
     */
    /**
     * @return tag.add_time : 返回 添加时间
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置添加时间
     *
     * @param addTime 添加时间
     */
    /**
     * @param addTime of tag : 设置 添加时间
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取所属分类，关联tag_sorts表
     *
     * @return parent_code - 所属分类，关联tag_sorts表
     */
    /**
     * @return tag.parent_code : 返回 所属分类，关联tag_sorts表
     */
    public String getParentCode() {
        return parentCode;
    }

    /**
     * 设置所属分类，关联tag_sorts表
     *
     * @param parentCode 所属分类，关联tag_sorts表
     */
    /**
     * @param parentCode of tag : 设置 所属分类，关联tag_sorts表
     */
    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    /**
     * 获取逻辑删除
     *
     * @return deleted - 逻辑删除
     */
    /**
     * @return tag.deleted : 返回 逻辑删除
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置逻辑删除
     *
     * @param deleted 逻辑删除
     */
    /**
     * @param deleted of tag : 设置 逻辑删除
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", tagName=").append(tagName);
        sb.append(", clickNum=").append(clickNum);
        sb.append(", documentNum=").append(documentNum);
        sb.append(", addTime=").append(addTime);
        sb.append(", parentCode=").append(parentCode);
        sb.append(", deleted=").append(deleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Tag other = (Tag) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTagName() == null ? other.getTagName() == null : this.getTagName().equals(other.getTagName()))
            && (this.getClickNum() == null ? other.getClickNum() == null : this.getClickNum().equals(other.getClickNum()))
            && (this.getDocumentNum() == null ? other.getDocumentNum() == null : this.getDocumentNum().equals(other.getDocumentNum()))
            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
            && (this.getParentCode() == null ? other.getParentCode() == null : this.getParentCode().equals(other.getParentCode()))
            && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTagName() == null) ? 0 : getTagName().hashCode());
        result = prime * result + ((getClickNum() == null) ? 0 : getClickNum().hashCode());
        result = prime * result + ((getDocumentNum() == null) ? 0 : getDocumentNum().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        result = prime * result + ((getParentCode() == null) ? 0 : getParentCode().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }
}